﻿using System;
using System.Linq;

namespace PServiceBus.MessageProxy {
    public static class ProxyService {

        public static T Create<T>() where T : class {
            var proxyType = ProxyHelper.CreateProxy<T>();
            var proxy = Activator.CreateInstance(proxyType);
            return proxy as T;
        }

        public static void Start() {
            ESBHelper.Initialize();
            ProxyHelper.StartServers();
        }

        public static void Shutdown() {
            ProxyHelper.Shutdown();
        }
    }
}
